﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Settings" targetNamespace="http://tempuri.org/Settings.xsd" xmlns:mstns="http://tempuri.org/Settings.xsd" xmlns="http://tempuri.org/Settings.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="DIAptekaConnectionString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="DIAptekaConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.DIProject.Properties.Settings.GlobalReference.Default.DIAptekaConnectionString" Provider="System.Data.SqlClient">
          </Connection>
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ContragentsTableAdapter" GeneratorDataComponentClassName="ContragentsTableAdapter" Name="Contragents" UserDataComponentName="ContragentsTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="DIAptekaConnectionString (Settings)" DbObjectName="DIApteka.CA.Contragents" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="False" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="False">
                    <CommandText>SELECT        Id, Name, ShortName
FROM            CA.Contragents
ORDER BY Name</CommandText>
                    <Parameters>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Id" DataSetColumn="Id" />
              <Mapping SourceColumn="Name" DataSetColumn="Name" />
              <Mapping SourceColumn="ShortName" DataSetColumn="ShortName" />
            </Mappings>
            <Sources>
            </Sources>
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="DepartmentsTableAdapter" GeneratorDataComponentClassName="DepartmentsTableAdapter" Name="Departments" UserDataComponentName="DepartmentsTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="DIAptekaConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="False" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT     - 999999 AS Id, ' Выберите подразделение' AS Name
UNION ALL
SELECT     Id, Name
FROM         CO.Departments
ORDER BY Name</CommandText>
                    <Parameters>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Id" DataSetColumn="Id" />
              <Mapping SourceColumn="Name" DataSetColumn="Name" />
            </Mappings>
            <Sources>
            </Sources>
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="FirmSettingsTableAdapter" GeneratorDataComponentClassName="FirmSettingsTableAdapter" Name="FirmSettings" UserDataComponentName="FirmSettingsTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="DIAptekaConnectionString (Settings)" DbObjectName="DilanOstankino.CO.FirmSettings" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="False" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT     Id, Profile, Note, MD, MW
FROM         CO.FirmSettings</CommandText>
                    <Parameters>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="StoredProcedure" ModifiedByUser="True">
                    <CommandText>FirmSettingsUpdate</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Xml" Direction="Input" ParameterName="@Profile" Precision="0" ProviderType="Xml" Scale="0" Size="0" SourceColumn="Profile" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Note" Precision="0" ProviderType="VarChar" Scale="0" Size="250" SourceColumn="Note" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@MD" Precision="0" ProviderType="DateTime" Scale="0" Size="0" SourceColumn="MD" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MW" Precision="0" ProviderType="VarChar" Scale="0" Size="50" SourceColumn="MW" SourceColumnNullMapping="False" SourceVersion="Current">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_Id" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="Id" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                      <Parameter AllowDbNull="False" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@Original_MD" Precision="0" ProviderType="DateTime" Scale="0" Size="0" SourceColumn="MD" SourceColumnNullMapping="False" SourceVersion="Original">
                      </Parameter>
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Id" DataSetColumn="Id" />
              <Mapping SourceColumn="Profile" DataSetColumn="Profile" />
              <Mapping SourceColumn="Note" DataSetColumn="Note" />
              <Mapping SourceColumn="MD" DataSetColumn="MD" />
              <Mapping SourceColumn="MW" DataSetColumn="MW" />
            </Mappings>
            <Sources>
            </Sources>
          </TableAdapter>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="ReportContragentsTableAdapter" GeneratorDataComponentClassName="ReportContragentsTableAdapter" Name="ReportContragents" UserDataComponentName="ReportContragentsTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="DIAptekaConnectionString (Settings)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="False" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="True" UserGetMethodName="GetData" UserSourceName="Fill">
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="True">
                    <CommandText>SELECT     CA.Contragents.Id, PR.ContragentVsContragents.ParentContragentId, CA.Contragents.Name, CA.Contragents.ShortName, 
                      PC.ShortName AS ParentName
FROM         CA.Contragents LEFT OUTER JOIN
                      PR.ContragentVsContragents ON PR.ContragentVsContragents.ChildContragentId = CA.Contragents.Id LEFT OUTER JOIN
                      CA.Contragents AS PC ON PC.Id = PR.ContragentVsContragents.ParentContragentId
WHERE     (CA.Contragents.IsSeller = 1)
ORDER BY CA.Contragents.Name</CommandText>
                    <Parameters>
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="Id" DataSetColumn="Id" />
              <Mapping SourceColumn="ParentContragentId" DataSetColumn="ParentContragentId" />
              <Mapping SourceColumn="Name" DataSetColumn="Name" />
              <Mapping SourceColumn="ShortName" DataSetColumn="ShortName" />
              <Mapping SourceColumn="ParentName" DataSetColumn="ParentName" />
            </Mappings>
            <Sources>
            </Sources>
          </TableAdapter>
        </Tables>
        <Sources>
        </Sources>
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="Settings" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="Settings" msprop:Generator_DataSetName="Settings">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="Contragents" msprop:Generator_UserTableName="Contragents" msprop:Generator_RowDeletedName="ContragentsRowDeleted" msprop:Generator_RowChangedName="ContragentsRowChanged" msprop:Generator_RowClassName="ContragentsRow" msprop:Generator_RowChangingName="ContragentsRowChanging" msprop:Generator_RowEvArgName="ContragentsRowChangeEvent" msprop:Generator_RowEvHandlerName="ContragentsRowChangeEventHandler" msprop:Generator_TableClassName="ContragentsDataTable" msprop:Generator_TableVarName="tableContragents" msprop:Generator_RowDeletingName="ContragentsRowDeleting" msprop:Generator_TablePropName="Contragents">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Id" msdata:ReadOnly="true" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="Id" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_ColumnPropNameInTable="IdColumn" type="xs:int" />
              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:nullValue="_empty" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn" msprop:Generator_ColumnPropNameInRow="Name">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="ShortName" msprop:Generator_UserColumnName="ShortName" msprop:nullValue="_empty" msprop:Generator_ColumnPropNameInRow="ShortName" msprop:Generator_ColumnPropNameInTable="ShortNameColumn" msprop:Generator_ColumnVarNameInTable="columnShortName" default="ВП">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="Departments" msprop:Generator_UserTableName="Departments" msprop:Generator_RowDeletedName="DepartmentsRowDeleted" msprop:Generator_RowChangedName="DepartmentsRowChanged" msprop:Generator_RowClassName="DepartmentsRow" msprop:Generator_RowChangingName="DepartmentsRowChanging" msprop:Generator_RowEvArgName="DepartmentsRowChangeEvent" msprop:Generator_RowEvHandlerName="DepartmentsRowChangeEventHandler" msprop:Generator_TableClassName="DepartmentsDataTable" msprop:Generator_TableVarName="tableDepartments" msprop:Generator_RowDeletingName="DepartmentsRowDeleting" msprop:Generator_TablePropName="Departments">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Id" msdata:ReadOnly="true" msprop:Generator_UserColumnName="Id" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_ColumnPropNameInTable="IdColumn" type="xs:int" />
              <xs:element name="Name" msdata:ReadOnly="true" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="FirmSettings" msprop:Generator_UserTableName="FirmSettings" msprop:Generator_RowDeletedName="FirmSettingsRowDeleted" msprop:Generator_RowChangedName="FirmSettingsRowChanged" msprop:Generator_RowClassName="FirmSettingsRow" msprop:Generator_RowChangingName="FirmSettingsRowChanging" msprop:Generator_RowEvArgName="FirmSettingsRowChangeEvent" msprop:Generator_RowEvHandlerName="FirmSettingsRowChangeEventHandler" msprop:Generator_TableClassName="FirmSettingsDataTable" msprop:Generator_TableVarName="tableFirmSettings" msprop:Generator_RowDeletingName="FirmSettingsRowDeleting" msprop:Generator_TablePropName="FirmSettings">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Id" msprop:Generator_UserColumnName="Id" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnPropNameInTable="IdColumn" type="xs:int" />
              <xs:element name="Profile" msprop:Generator_UserColumnName="Profile" msprop:Generator_ColumnVarNameInTable="columnProfile" msprop:Generator_ColumnPropNameInRow="Profile" msprop:Generator_ColumnPropNameInTable="ProfileColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="Note" msprop:Generator_UserColumnName="Note" msprop:Generator_ColumnVarNameInTable="columnNote" msprop:Generator_ColumnPropNameInRow="Note" msprop:Generator_ColumnPropNameInTable="NoteColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="250" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="MD" msprop:Generator_UserColumnName="MD" msprop:Generator_ColumnVarNameInTable="columnMD" msprop:Generator_ColumnPropNameInRow="MD" msprop:Generator_ColumnPropNameInTable="MDColumn" type="xs:dateTime" />
              <xs:element name="MW" msprop:Generator_UserColumnName="MW" msprop:Generator_ColumnVarNameInTable="columnMW" msprop:Generator_ColumnPropNameInRow="MW" msprop:Generator_ColumnPropNameInTable="MWColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="ReportContragents" msprop:Generator_UserTableName="ReportContragents" msprop:Generator_RowDeletedName="ReportContragentsRowDeleted" msprop:Generator_TableClassName="ReportContragentsDataTable" msprop:Generator_RowChangedName="ReportContragentsRowChanged" msprop:Generator_RowClassName="ReportContragentsRow" msprop:Generator_RowChangingName="ReportContragentsRowChanging" msprop:Generator_RowEvArgName="ReportContragentsRowChangeEvent" msprop:Generator_RowEvHandlerName="ReportContragentsRowChangeEventHandler" msprop:Generator_TablePropName="ReportContragents" msprop:Generator_TableVarName="tableReportContragents" msprop:Generator_RowDeletingName="ReportContragentsRowDeleting">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Id" msprop:Generator_UserColumnName="Id" msprop:Generator_ColumnPropNameInRow="Id" msprop:Generator_ColumnVarNameInTable="columnId" msprop:Generator_ColumnPropNameInTable="IdColumn" type="xs:int" />
              <xs:element name="ParentContragentId" msprop:Generator_UserColumnName="ParentContragentId" msprop:Generator_ColumnPropNameInRow="ParentContragentId" msprop:Generator_ColumnVarNameInTable="columnParentContragentId" msprop:Generator_ColumnPropNameInTable="ParentContragentIdColumn" type="xs:int" minOccurs="0" />
              <xs:element name="Name" msprop:Generator_UserColumnName="Name" msprop:Generator_ColumnPropNameInRow="Name" msprop:Generator_ColumnVarNameInTable="columnName" msprop:Generator_ColumnPropNameInTable="NameColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="ShortName" msprop:Generator_UserColumnName="ShortName" msprop:Generator_ColumnPropNameInRow="ShortName" msprop:Generator_ColumnVarNameInTable="columnShortName" msprop:Generator_ColumnPropNameInTable="ShortNameColumn">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="ParentName" msprop:Generator_UserColumnName="ParentName" msprop:Generator_ColumnPropNameInRow="ParentName" msprop:Generator_ColumnVarNameInTable="columnParentName" msprop:Generator_ColumnPropNameInTable="ParentNameColumn" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="20" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="CrossTable" msprop:Generator_UserTableName="CrossTable" msprop:Generator_RowDeletedName="CrossTableRowDeleted" msprop:Generator_TableClassName="CrossTableDataTable" msprop:Generator_RowChangedName="CrossTableRowChanged" msprop:Generator_RowClassName="CrossTableRow" msprop:Generator_RowChangingName="CrossTableRowChanging" msprop:Generator_RowEvArgName="CrossTableRowChangeEvent" msprop:Generator_RowEvHandlerName="CrossTableRowChangeEventHandler" msprop:Generator_TablePropName="CrossTable" msprop:Generator_TableVarName="tableCrossTable" msprop:Generator_RowDeletingName="CrossTableRowDeleting">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Department" msprop:Generator_UserColumnName="Department" msprop:Generator_ColumnPropNameInRow="Department" msprop:Generator_ColumnVarNameInTable="columnDepartment" msprop:Generator_ColumnPropNameInTable="DepartmentColumn" type="xs:string" minOccurs="0" />
              <xs:element name="DepartmentId" msprop:Generator_UserColumnName="DepartmentId" msprop:Generator_ColumnPropNameInRow="DepartmentId" msprop:Generator_ColumnVarNameInTable="columnDepartmentId" msprop:Generator_ColumnPropNameInTable="DepartmentIdColumn" type="xs:int" minOccurs="0" />
              <xs:element name="Contragent" msprop:Generator_UserColumnName="Contragent" msprop:Generator_ColumnPropNameInRow="Contragent" msprop:Generator_ColumnVarNameInTable="columnContragent" msprop:Generator_ColumnPropNameInTable="ContragentColumn" type="xs:string" minOccurs="0" />
              <xs:element name="ContragentId" msprop:Generator_UserColumnName="ContragentId" msprop:Generator_ColumnPropNameInRow="ContragentId" msprop:Generator_ColumnVarNameInTable="columnContragentId" msprop:Generator_ColumnPropNameInTable="ContragentIdColumn" type="xs:int" minOccurs="0" />
              <xs:element name="RoznSum" msdata:Caption="NopaySum" msprop:Generator_UserColumnName="RoznSum" msprop:Generator_ColumnPropNameInRow="RoznSum" msprop:Generator_ColumnVarNameInTable="columnRoznSum" msprop:Generator_ColumnPropNameInTable="RoznSumColumn" type="xs:decimal" minOccurs="0" />
              <xs:element name="OptSum" msdata:Caption="NopaySumBefore" msprop:Generator_UserColumnName="OptSum" msprop:Generator_ColumnPropNameInRow="OptSum" msprop:Generator_ColumnVarNameInTable="columnOptSum" msprop:Generator_ColumnPropNameInTable="OptSumColumn" type="xs:decimal" minOccurs="0" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:Contragents" />
      <xs:field xpath="mstns:Id" />
    </xs:unique>
    <xs:unique name="Departments_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:Departments" />
      <xs:field xpath="mstns:Id" />
    </xs:unique>
    <xs:unique name="FirmSettings_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:FirmSettings" />
      <xs:field xpath="mstns:Id" />
    </xs:unique>
  </xs:element>
</xs:schema>